LtU Forum, Site Discussion

[admin] Domain lookup issues fixed

Since Wednesday, there have been intermittent problems with lookup of the lambda-the-ultimate.org domain name. This was due to problems with our domain registrar, joker.com, which says it has been experiencing "massive distributed denial of service attacks" against its nameservers. Whether you experienced the problem depends on DNS caching and timing.

Although Joker continues to experience problems, we've now switched to domain name servers elsewhere, so the problem is resolved.

Extremely static language?

Hi,
I'm interested in languages which do compile time restrictions on the values of variables. Specifically, does anything like the following exist:

x : int [0, 2, ... 10]
x = 50 //error
x = 3 // error
x = 2 // ok

x = rand() // error, rand() : [0.0 ... 1.0] doesn't match [0, 2, ... 10]
x = floor(rand() * 2) * 2 // ok [0, 2, 4] is a subset of [0, 2, ...10]

Thanks,

Alex

Google Reader and "continuations"

Reading this I got curious, so I did some googling (natrually). This is what I came up with.

If someone knows more, please share!

I "got" imperative programming throught data binding

Macromedia flex has a very powerfull data-binding mechanism. When we started to use Flex we had heaps of code to manage events. We were also suspicious about mixing content and behaviour. What a mistake!
Progressivly we've been using the declarative syntax of data-binding and our amount of code has reduced enourmously.
In fact we don't event think of it as code, we think of it as magic statements that just glue everything :)

Multimethods in a latently typed language?

(I posted this initially to comp.lang.misc and was told to try here instead)

I'm implementing a vaguely scheme-like scripting language and I'm a
unclear on how to make multimethods work (not just within an object
system, but with all the language types). Are "types" just symbols or
do they require their own namespace?

(defun f ( (x 'int) (y 'string)) (...code))
-or-
(defun f ( (x (resolve-type int)) (y (resolve-type string)) ) (...code))

Should I combine the concept of class and and type? This seems
problematic since I want objects to be runtime-modifiable (add/remove
methods). I was also considering making predicate types as the basis
for method resolution (obj has_method x, etc..), but then how do I fit
in primitive types?

I guess I'm a bit overwhelmed with type systems and would appreciate
some direction.

Thanks,
-Alex

Problem with forum listings

Hello,

I was looking through the forum of active topics. And there's a problem with the buttons such as "Created". Once you click on it, it adds ?sort=asc&order=Created to the end of the url. You would think that clicking on this again would turn the sort=asc to sort=desc. (Manually typing this in in the addressbar has the expected result). I would also think that a priori people want to see the most recent post first (which is what I was trying to achieve), and therefore start with sort=desc instead of sort=asc. However the main bug is the fact that clicking on the "Created button" again lenghtens the url so that it now becomes: ?sort=asc&order=Created&order=Created

Using continuations in Web applications is patented

I just read this post from Paul Graham's new blog. It turns out he has a patent for using continuations to make page transitions look like function calls. The patent number is 6,205,469. Makes me a little sad.

Reversible generators

Python has a language feature that's been brought up here a couple of times before, whereby a function can return a value, but remember it's current point of execution, and restart execution from there the next time the function is called. Here's a simple example:

def myrange(a, b):
   while a <= b:
      yield a
      a += 1

I'm curious if any work has been done looking into making generators more arbitrarily maniputable. If I want to define a function reverse(myrange(1, 10)), Python will have to do the entire generation at once and then perform the reversal. This eliminates one of the key advantages of generators -- making only one object at a time, and thus saving memory and potentially latency.

What I'm curious about is if anyone's done any work into what constraints would be necessary on generators (obviously they couldn't have arbitrary python code as they can now) to make it so that a reverse() would be possible that would still have each value be generated once a time, just in reverse. Presumably such a solution would be powerful enough to implement things like step too (currently to get the effect of step with a generator you have to just throw values out).

sublanguages of CTM's Oz

I've been reading van Roy and Haridi's Concepts, Techniques, and Models of Computer Programming. It is an exciting and thought-provoking work. I have one major criticism of it that I thought LtU participants might be interested in discussing. While Oz does a great job of incorporating multiple programming models into a single language, to me what it lacks is a way of constraining oneself to a particular model or set of models, and demonstrating to others that these constraints have been met.

For example, I would like a way to assert that a function is declarative (i.e. is truly a function), and have this be enforced. I suppose this would have to be enforced at run-time to fit with the dynamically typed language design. Also, I'm not sure how this would be enforced; a conservative strategy would be to consider any use of NewCell or Exchange as non-declarative, but this would yield "false positives" in cases where state is used in a function that is still observationally declarative (e.g. is just using state for memoization).

Perhaps I want something more like monads in Haskell, where the fact that function that is not observationally declarative will be reflected in its type (and the way must be used). But this may be an inappropriate comparison because Haskell is a one-model language and is only simulating a stateful model via monads. And of course it is statically typed. In fact the CTM authors specifically mention (page xxi) that they disfavor the monadic approach to state because it is too explicit, violating modularity by making the use of state change the interface to a function (if I understand them correctly).

On the flip side, I'd say modularity is better supported by a language in which design contracts (e.g. do you use state) can be enforced. It all comes down to whether you think the use of state is a private or public manner, or perhaps under the choice of the programmer whether to make it private or public (and if the programmer chooses to keep that choice private, we are forced to make the conservative assumption that he did use state).

XML feed